<#assign pageName="登录日志管理">
<@override name="page-content">
<form class="layui-form form-horizontal" role="form" method="post">
    <div class="layui-form-search panel">
        <input type="text" hidden="hidden" name="_STATE"/>
        <@ctrl.SingleSelectQuery path="sysLoginInfo.status" options={"0":"成功", "1":"失败"} text="1" value="0" labelText="登录状态">
            <option value="">—请选择登录状态—</option>
        </@ctrl.SingleSelectQuery>
        <@ctrl.TextboxQuery path="sysLoginInfo.userName" labelText="登录账号"/>
        <@ctrl.TextboxQuery path="sysLoginInfo.ipaddr" labelText="登录IP"/>
        <@ctrl.DateQuery path="sysLoginInfo.queryStartDate" labelText="开始时间"/>
        <@ctrl.DateQuery path="sysLoginInfo.queryEndDate" labelText="截止日期"/>
        <div class="margin-5">
             <a href="javascript:;" onclick="$('form:first').submit();" class="layui-btn layui-btn-sm">
                 <i class="layui-icon layui-icon-search"></i>查询
             </a>
             <a href="javascript:;" class="layui-btn layui-btn-warm layui-btn-sm js-reset">
                <i class="layui-icon layui-icon-refresh-1"></i>重置
             </a>
         </div>
    </div>
    <table class="layui-table">
        <thead>
            <tr>
                <th class="align-center" width="50px" nowrap="nowrap">序号</th>
                <th class="align-center" nowrap="nowrap">登录状态</th>
                <th class="align-center" nowrap="nowrap">登录账号</th>
                <th class="align-center" nowrap="nowrap">登录IP</th>
                <th class="align-center layui-hide-xs">登录地址</th>
                <th class="align-center layui-hide-xs">浏览器类型</th>
                <th class="align-center layui-hide-xs">系统类型</th>
                <th class="align-center layui-hide-xs">提示信息</th>
                <th class="align-center">访问时间</th>
            </tr>
        </thead>
        <tbody>
            <#if queryResult.rows?has_content>
                <#list queryResult.rows as dataItem>  
                <tr>
                    <td class="align-center" width="50px" nowrap="nowrap">
                        ${(pageNo-1)*pageSize+dataItem_index+1}
                    </td>
                    <td class="align-center" nowrap="nowrap">
                        <#if dataItem.status == "0">
                            <font color="green">成功</font>
                        <#elseif dataItem.status == "1">
                            <font color="red">失败</font>
                        </#if>
                    </td>
                    <td class="align-center" nowrap="nowrap">
                        ${dataItem.userName}
                    </td>
                    <td class="align-center" >
                        ${dataItem.ipaddr}
                    </td>
                    <td class="layui-hide-xs">
                        ${dataItem.loginLocation}
                    </td>
                    <td class="align-center layui-hide-xs">
                        ${dataItem.browser}
                    </td>
                    <td class="align-center layui-hide-xs">
                        ${dataItem.os}
                    </td>
                    <td class="layui-hide-xs">
                        ${dataItem.msg}
                    </td>
                    <td class="align-center">
                        ${dataItem.loginTime}
                    </td>
                </tr>
                </#list>
            <#else>
                 <tr>
                    <td colspan="9" style="color:red;text-align:center;font-weight:bold;">暂无符合条件的日志信息</td>
                 </tr>
            </#if>
            </tbody>
        </table>
        <@ctrl.pageShow (queryResult.total)!0, (queryResult.pageIndex)!0 />
    </form>
</@override>
<@override name="page-scripts">
      <script>
        $(function(){
            layui.use(['form','layer','laydate','jquery'], function(){
                var form=layui.form;
                var layer=layui.layer;
                var laydate = layui.laydate;
                var $ = layui.jquery;
                laydate.render({
                  elem: '#queryStartDate'
                });
                laydate.render({
                    elem: '#queryEndDate'
                });
                $('.js-reset').on('click', function(){
                    $('#pageNo').val(1);
                    $('#level').val("");
                    $('#userName').val("");
                    $('#ipaddr').val("");
                    $('#status').val("");
                    $('#queryStartDate').val("");
                    $('#queryEndDate').val("");
                    $('form:first').submit();
                })
            })
        })
    </script>
</@override>
<@extends name="/layout/basepage.html"/> 
